//package com.nifty.base.mq.config;
//
//import com.nifty.base.message.controller.WebSocketServerEndpoint;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.amqp.rabbit.support.CorrelationData;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//
//@Component
//public class RabbitSender implements RabbitTemplate.ConfirmCallback {
//    @Resource
//    private RabbitTemplate rabbitTemplate;
//
//    @Value("${META-INF.rabbitmq.queue.exchange}")
//    private static String exchange;
//    @Value("${META-INF.rabbitmq.routingKey}")
//    private static String routingKey;
//
//    public void sendMsg(String content) {
//        WebSocketServerEndpoint.sendMessage(1L,content);
//    }
//
//    //回调
//    @Override
//    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
//        System.out.println(" 回调id:" + correlationData);
//        if (ack) {
//            System.out.println("消息成功消费");
//        } else {
//            System.out.println("消息消费失败:" + cause);
//        }
//    }
//}